package com.ebupt.migu.music.api.controller;

import com.ebupt.migu.music.api.entity.CMSNoticeRequest;
import com.ebupt.migu.music.api.entity.CMSNoticeResponse;
import com.ebupt.migu.music.api.service.CMSNoticeService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.text.SimpleDateFormat;
import java.util.Date;

/**
 * Created by Intellij IDEA.
 * User:  liuyangyang@cd.ebupt.com
 * Date:  2019/10/18
 */
@Slf4j
@RestController
@RequestMapping("/1")
public class CMSNoticeController {

    @Autowired
    private CMSNoticeService cmsNoticeService;

    /**
     * cms通知商户更新活动列表
     *
     * @param cmsNoticeRequest
     * @return
     */
    @RequestMapping(value = "/updatenotice.json", produces = MediaType.APPLICATION_JSON_VALUE)
    public CMSNoticeResponse updateNotice(CMSNoticeRequest cmsNoticeRequest) {
        log.info("CMS通知活动更新，通知内容{}", cmsNoticeRequest.toString());
        return cmsNoticeService.updateNotice(cmsNoticeRequest);
    }

}
